/**
 * Created by PanJiaChen on 16/11/18.
 */

/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
}

/**
 * @param {string} str
 * @param callback
 * @returns {Boolean}
 */
export function validUsername(str, callback) {
  if (!str) {
    callback(new Error('手机号码不能为空'))
  } else {
    callback()
  }
}
